import { request } from '@/utils/request';

// 手机号登录
export function phone(data) {
  return request({
    url: '/login/phone',
    method: 'POST',
    data
  });
}

// 用户登录
export function login(data) {
  return request({
    url: '/login',
    method: 'POST',
    data
  });
}

// 微信登录
export function wechatApp(data) {
  return request({
    url: '/login/wechatApp',
    method: 'POST',
    data
  });
}

// 登录时手机号绑定微信和苹果
export function bindPhoneApp(data) {
  return request({
    url: '/login/bind',
    method: 'POST',
    data
  });
}

// 苹果登录
export function apple(data) {
  return request({
    url: '/login/apple',
    method: 'POST',
    data
  });
}

// 获取登录验证码
export function sendVerifyCode(data) {
  return request({
    url: '/sms/sendVerifyCode',
    method: 'POST',
    data
  });
}

// 用户注册
export function register(data) {
  return request({
    url: '/register',
    method: 'POST',
    data
  });
}

// 注册校验码校验
export function checkPhone(data) {
  return request({
    url: '/register/checkPhone',
    method: 'POST',
    data
  });
}

// 退出登录
export function logout(data) {
  return request({
    url: '/logout',
    method: 'POST',
    data
  });
}

// 手机号一键登录
export function loginByPhoneAuth(data) {
  return request({
    url: '/loginByPhoneAuth',
    method: 'POST',
    data
  });
}

// 登录后绑定微信
export function providerbindWechat(data) {
  return request({
    url: '/provider/bindWechat',
    method: 'POST',
    data
  });
}

// 登录后解绑微信
export function providerunbindWechat() {
  return request({
    url: '/provider/unbindWechat',
    method: 'POST',
    data: {}
  });
}
